/*
 Navicat Premium Data Transfer

 Source Server         : shujuku
 Source Server Type    : MySQL
 Source Server Version : 50721
 Source Host           : localhost:3306
 Source Schema         : golang

 Target Server Type    : MySQL
 Target Server Version : 50721
 File Encoding         : 65001

 Date: 13/04/2018 13:43:44
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for auth_group
-- ----------------------------
DROP TABLE IF EXISTS `auth_group`;
CREATE TABLE `auth_group` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `title` char(100) NOT NULL DEFAULT '',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `rules` char(80) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of auth_group
-- ----------------------------
BEGIN;
INSERT INTO `auth_group` VALUES (1, '超级管理员', 1, '1,3,4,5,6,7,8');
INSERT INTO `auth_group` VALUES (2, '文章管理', 1, '');
COMMIT;

-- ----------------------------
-- Table structure for auth_group_access
-- ----------------------------
DROP TABLE IF EXISTS `auth_group_access`;
CREATE TABLE `auth_group_access` (
  `uid` mediumint(8) unsigned NOT NULL,
  `group_id` mediumint(8) unsigned NOT NULL,
  UNIQUE KEY `uid_group_id` (`uid`,`group_id`),
  KEY `uid` (`uid`),
  KEY `group_id` (`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of auth_group_access
-- ----------------------------
BEGIN;
INSERT INTO `auth_group_access` VALUES (1, 1);
COMMIT;

-- ----------------------------
-- Table structure for rule
-- ----------------------------
DROP TABLE IF EXISTS `rule`;
CREATE TABLE `rule` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(11) NOT NULL,
  `name` char(80) NOT NULL DEFAULT '',
  `title` char(20) NOT NULL DEFAULT '',
  `type` tinyint(1) NOT NULL DEFAULT '1',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `condition` char(100) NOT NULL DEFAULT '',
  `p_id` varchar(32) DEFAULT NULL,
  `level` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of rule
-- ----------------------------
BEGIN;
INSERT INTO `rule` VALUES (1, 0, 'admin/index', '后台首页', 1, 0, '', '0,', 1);
INSERT INTO `rule` VALUES (3, 0, 'admin/showrule/index', '权限控制', 1, 1, '', '0,', 1);
INSERT INTO `rule` VALUES (4, 1, 'admin/index/welcome', '后台欢迎页', 1, 0, '', '0,1,', 2);
INSERT INTO `rule` VALUES (5, 3, 'admin/rule/index', '权限管理', 1, 1, '', '0,3,', 2);
INSERT INTO `rule` VALUES (6, 5, 'admin/rule/add', '权限添加', 1, 1, '', '0,3,5,', 3);
INSERT INTO `rule` VALUES (7, 5, 'admin/rule/del', '权限删除', 1, 1, '', '0,3,5,', 3);
INSERT INTO `rule` VALUES (8, 5, 'admin/rule/edit', '权限修改', 1, 1, '', '0,3,5,', 3);
INSERT INTO `rule` VALUES (9, 5, 'asdf', 'asfd', 1, 1, '', NULL, NULL);
INSERT INTO `rule` VALUES (10, 5, '123', 'asdf', 1, 1, '', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(32) NOT NULL,
  `password` varchar(50) NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'gewen', '123', 1);
INSERT INTO `user` VALUES (2, 'ceshi', '123', 0);
INSERT INTO `user` VALUES (7, 'demo11', '123', 0);
INSERT INTO `user` VALUES (15, 'nihao', '123', 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
